<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8"/>
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>

    <meta name="keywords" content="凌云数据后台管理框架">
    <meta name="description" content="轻量级的网站后台管理系统模版">

    <title>首页</title>

    <link href="../plugin/bootstrap-3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="../plugin/bootstrap-table-1.11.1/bootstrap-table.min.css" rel="stylesheet"/>
    <link href="../plugin/sweetalert-6.6.2/sweetalert2.min.css" rel="stylesheet"/>
    <link href="../plugin/jstree/jstree.min.css" rel="stylesheet">
    <link href="../plugin/sccl/css/sccl.css" rel="stylesheet" type="text/css">
    <link href="../plugin/sccl/skin/qingxin/skin.css" id="layout-skin" rel="stylesheet" type="text/css"/>
    <link href="../plugin/sweetalert-6.6.2/sweetalert2.min.css" rel="stylesheet" type="text/css">
</head>

<body>
<div class="layout-admin">
    <header class="layout-header">
        <span class="header-logo">系统框架</span> <a class="header-menu-btn" href="javascript:;"><i class="icon-font">&#xe600;</i></a>
        <ul class="header-bar">
            <li class="header-bar-role"><a href="javascript:;"><span id="roleName"></span></a></li>
            <li class="header-bar-nav"><a href="javascript:;"><span id="userName"></span><i class="icon-font"
                                                                                            style="margin-left: 5px;">&#xe60c;</i></a>
                <ul class="header-dropdown-menu">
                    <li><a href="javascript:;" onclick="resetPassword()">修改密码</a></li>
                    <li><a href="javascript:;" onclick="quit()">退出</a></li>
                </ul>
            </li>
            <li class="header-bar-nav"><a href="javascript:;" title="换肤"><i class="icon-font">&#xe608;</i></a>
                <ul class="header-dropdown-menu right dropdown-skin">
                    <li><a href="javascript:;" onclick="sccl.changeSkin('qingxin')" data-val="qingxin" title="清新">清新</a>
                    </li>
                    <li><a href="javascript:;" onclick="sccl.changeSkin('blue')" data-val="blue" title="蓝色">蓝色</a></li>
                    <li><a href="javascript:;" onclick="sccl.changeSkin('molv')" data-val="molv" title="墨绿">墨绿</a></li>
                </ul>
            </li>
        </ul>
    </header>
    <aside class="layout-side">
        <ul class="side-menu">
            <li class="menu-header"><i class="icon-font">&#xe601;</i>&nbsp;&nbsp;菜单</li>
        </ul>
    </aside>

    <div class="layout-side-arrow">
        <div class="layout-side-arrow-icon">
            <i class="icon-font">&#xe60d;</i>
        </div>
    </div>

    <section class="layout-main">
        <div class="layout-main-tab">
            <button class="tab-btn btn-left">
                <i class="icon-font">&#xe60e;</i>
            </button>
            <nav class="tab-nav">
                <div class="tab-nav-content">
                    <a href="javascript:;" class="content-tab active" data-id="home.html">首页</a>
                </div>
            </nav>
            <button class="tab-btn btn-right">
                <i class="icon-font">&#xe60f;</i>
            </button>
        </div>
        <div class="layout-main-body">
            <iframe class="body-iframe" name="iframe0" width="100%" height="99%" src="home.html" frameborder="0"
                    data-id="home.html" seamless></iframe>
        </div>
    </section>
    <div class="layout-footer">@2017.10.18 福州凌云数据</div>
</div>

<script src="../plugin/jquery-3.2.1/jquery-3.2.1.min.js"></script>
<script src="../plugin/bootstrap-3.3.7/js/bootstrap.min.js"></script>
<script src="../plugin/bootstrap-table-1.11.1/bootstrap-table.min.js"></script>
<script src="../plugin/bootstrap-table-1.11.1/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="../plugin/sweetalert-6.6.2/sweetalert2.min.js"></script>
<script src="../plugin/jquery-3.2.1/jquery.formautofill.min.js"></script>
<script src="../plugin/soul/utils3.js"></script>
<script src='../js/base.js'></script>
<script src="../plugin/jquery-3.2.1/jquery.serializejson.js"></script>
<script src="../plugin/jstree/jstree.min.js"></script>
<script src="../plugin/wangEditor-3.0.15/wangEditor.min.js"></script>
<script src="../plugin/sccl/js/sccl.js"></script>

<div class="modal fade in" data-backdrop="static" id="index_modal_change_password">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button class="close" data-dismiss="modal">
                    <span>&times;</span>
                </button>
                <h4 class="modal-title">
                    <b>修改密码</b>
                </h4>
            </div>
            <div class="panel panel-default">
                <div class="panel-body">
                    <div class="form-group"><label class="col-sm-2 control-label">输入旧密码:</label>
                        <div class="col-sm-9">
                            <input type="text" id="old_password" name="old_password" class="form-control" placeholder="请输入文本">
                            &nbsp;&nbsp;
                        </div>
                    </div>
                    <div></div>
                    <div class="form-group"><label class="col-sm-2 control-label">输入新密码:</label>
                        <div class="col-sm-9">
                            <input type="text" id="new_password" name="new_password" class="form-control" placeholder="请输入文本">
                            &nbsp;&nbsp;
                        </div>
                    </div>
                    <div class="form-group"><label class="col-sm-2 control-label">再次输入新密码:</label>
                        <div class="col-sm-9">
                            <input type="text" id="new_password_two" name="new_password_two" class="form-control" placeholder="请输入文本">
                            &nbsp;&nbsp;
                        </div>
                    </div>

                </div>
                <div class="modal-footer">
                    <button class="btn btn-primary" onclick="comfirm()">确认</button>
                    <button class="btn btn-default" data-dismiss="modal">取消</button>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        var user = AjaxUtil.isLogin();
        if (!user) return;
        $("#roleName").html(user.obj.roleName);
        $("#userName").html(user.obj.username);
        sccl.getSkinByLocalStorage();
        var resp = AjaxUtil.getJson('staff/myPriv');
        sccl.initMenu(resp.obj);
        $(".side-menu > li").addClass("menu-item");
    });

    function quit() {
        SwalUtil.confirm(function () {
            window.localStorage.token = "";
            window.location.href = "login.html";
        }, '您确定要退出吗?');
    }

    //点击修改密码显示模态框
    resetPassword = function () {
        $('#index_modal_change_password').modal('show');
    };

    //确认修改密码
    comfirm = function () {
        var oldPassword=$('#old_password').val();
        var newPassword=$('#new_password').val();
        var newPasswordTwo=$('#new_password_two').val();

        var resp = AjaxUtil.postJson('staffManager/changePassword', {
            oldPassword: oldPassword,
            newPassword:newPassword,
            newPasswordTwo:newPasswordTwo,
        });
        if (resp) {
            SwalUtil.success(resp.msg);
            $('#index_modal_change_password').modal('hide');
            setTimeout("window.location.href = \"login.html\";",2000)
        }
    }
</script>

</body>

</html>